var MyApp = new Vue({
	el: "#App",
	data: {
		Language: {},
		shop:MYSHOP,//店铺的详细信息
		shop_coupon:"",//优惠券
		member_card:{}//会员卡详细信息
//		COUPON
	},
	methods: {
		Langes: function(v) {
			$.ajax({
				type: "get",
				dataType: "json",
				url: "Langue/" + v + ".json",
				success: function(h) {
					MyApp.Language = h;
				},
				error: function(e) {
					console.log("错误");
				}
			});
		},
		created: function() {
			this.Langes("zh");
		},
		selectVal: function(ele) {
			this.Langes(ele.target.value);
			localStorage.setItem("lanuage", ele.target.value);			
            this.shop = common_ajax("get_shop_home","",ele.target.value);
            this.shop_coupon = common_ajax("get_other_shop_coupon_list","",ele.target.value);	
			lanuage();
		},
		payment:function(){
		  //渲染注册页面		  
		},
		alert:function(){
			alert();
		}
	}
})
//设置select选择的语言
function lanuage(){
	var l = localStorage.getItem("lanuage"); 
	if(l){
		$("select").find("option[value="+l+"]").attr("selected",true);
	}else $("select").find("option[value='en']").attr("selected",true);
}
lanuage();
//设置系统默认语言
if(localStorage.getItem("lanuage")){
	MyApp.Langes(localStorage.getItem("lanuage"));
}else MyApp.Langes("en")

